/*
 * WavefrontOBJ.cpp
 *
 *  Created on: Oct 10, 2010
 *      Author: rino
 */

#include "WavefrontOBJ.h"
#include "glm.h"
#include <cstdlib>

using namespace std;

WavefrontOBJ::WavefrontOBJ(char* filename) {
	pmodel = glmReadOBJ(filename);
	if (!pmodel)
		exit(0);
	glmUnitize(pmodel);
	glmFacetNormals(pmodel);
	glmVertexNormals(pmodel, 90.0);
}

void WavefrontOBJ::draw() {
	glmDraw(pmodel, GLM_SMOOTH);
}
